<template>
  <div class="dashboard-editor-container">
    <div class=" clearfix">
      <pan-thumb :image="avatar" style="float: left">
        您的权限是:
        <span v-for="item in roles" :key="item" class="pan-info-roles">{{ item }}</span>
      </pan-thumb>
      <github-corner style="position: absolute; top: 0px; border: 0; right: 0;" />
      <div class="info-container">
        <span class="display_name">你好，{{ name }}权限用户</span>
        <span style="font-size:20px;padding-top:20px;display:inline-block;">欢迎使用产品溯源系统！</span>
      </div>
    </div>
    <div class="index">
      <!-- 跑马灯  -->
      <div>
        <el-carousel :interval="4000" type="card" height="500px">
          <el-carousel-item v-for="item in imgList" :key="item.id">
            <img :src="item.idView" class="image">
          </el-carousel-item>
        </el-carousel>
      </div>
    </div>
    <!--    <div>-->
    <!--      <img :src="emptyGif" class="emptyGif">-->
    <!--    </div>-->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'
import GithubCorner from '@/components/GithubCorner'

export default {
  name: 'DashboardEditor',
  components: { PanThumb, GithubCorner },
  data() {
    return {
      emptyGif: 'https://pic2.zhimg.com/80/v2-acd5e08a23d34c82c8e8ce9262eeeea1_1440w.webp',
      imgList: [
        { id: 0, idView: 'https://pic1.zhimg.com/80/v2-b14496f8db09f88f36a5c25c32d6d288_1440w.webp' },
        { id: 1, idView: 'https://pica.zhimg.com/80/v2-dc7513e2ac3b4743262cc9ba839ca3bb_1440w.webp?source=1940ef5c' },
        { id: 2, idView: 'https://pica.zhimg.com/v2-0ab8599dee15ead9bcb3cba2b7b7fa1d_1440w.jpg?source=172ae18b' },
        { id: 3, idView: 'https://picx.zhimg.com/80/v2-dc343861619e24427e166526818dffb9_1440w.webp?source=1940ef5c' }
      ]
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'avatar',
      'roles'
    ])
  }
}
</script>

<style lang="scss" scoped>
//.index{
//  background: #c8cfd8;
//  width: 100%;
//  text-align: center;
//  margin-left: 142px;
//  width: 100%;
//
//}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #d3dce6;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}
.emptyGif {
    display: block;
    width: 45%;
    margin: 0 auto;
  }

  .dashboard-editor-container {
    background-color: #e3e3e3;
    min-height: 100vh;
    padding: 50px 60px 0px;
    .pan-info-roles {
      font-size: 12px;
      font-weight: 700;
      color: #333;
      display: block;
    }
    .info-container {
      position: relative;
      margin-left: 190px;
      height: 150px;
      line-height: 200px;
      .display_name {
        font-size: 48px;
        line-height: 48px;
        color: #212121;
        position: absolute;
        top: 25px;
      }
    }
  }
</style>
